package cn.virens.packet;

import cn.virens.common.ByteUtil;

public class WritePacket extends ReadPacket {
	private static final long serialVersionUID = 1L;

	/** 控制模式 */
	private String model = null;
	private boolean resume = false;

	public static WritePacket of(ReadPacket packet, String cmd) {
		WritePacket answer = new WritePacket();
		answer.data = ByteUtil.EMPTY_BYTES;
		answer.seq = packet.seq;
		answer.ver = packet.ver;
		answer.cmd = cmd;

		return answer;
	}

	public String model() {
		return model;
	}

	public void model(String model) {
		this.model = model;
	}

	public boolean resume() {
		return resume;
	}

	public void resume(boolean resume) {
		this.resume = resume;
	}

	public int len() {
		return data.length + 10;
	}
}